broadway: Disable all kinds of viewport scrolling and zooming
authorAlexander Larsson <alexl@redhat.com>
Tue, 12 Nov 2013 12:44:27 +0000 (13:44 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 12 Nov 2013 12:44:56 +0000 (13:44 +0100)
gdk/broadway/broadway.js
gdk/broadway/client.html

index c2d03b19c209195292c3b3ab7744017a3f50af3d..18d0d7f1d3f9872284abeed2f0837b5749d243dc 100644 (file)
@@ -2460,6 +2460,18 @@ function onMouseWheel(ev)
     return cancelEvent(ev);
 }
 
+function onTouchStart(ev) {
+    event.preventDefault();
+}
+
+function onTouchEnd(ev) {
+    event.preventDefault();
+}
+
+function onTouchMove(ev) {
+    event.preventDefault();
+}
+
 function setupDocument(document)
 {
     document.oncontextmenu = function () { return false; };
@@ -2475,6 +2487,9 @@ function setupDocument(document)
     if (document.addEventListener) {
       document.addEventListener('DOMMouseScroll', onMouseWheel, false);
       document.addEventListener('mousewheel', onMouseWheel, false);
+      document.addEventListener('touchstart', onTouchStart, false);
+      document.addEventListener('touchmove', onTouchMove, false);
+      document.addEventListener('touchstart', onTouchEnd, false);
     } else if (document.attachEvent) {
       element.attachEvent("onmousewheel", onMouseWheel);
     }
index a6996123d75223987b65998b7fdcedc7c280ddf5..42b5c45f01ce984b8fcca44e06c5b450fcff3fd5 100644 (file)
@@ -2,7 +2,11 @@
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
 <title>broadway 2.0</title>
+<style type="text/css">
+body { overflow: hidden; }
+</style>
 <script type="text/javascript" src="broadway.js"></script>
 </head>